package com.ruoyi.personnel.changes.event.service;

import com.ruoyi.personnel.changes.event.domain.EventRecord;
import com.ruoyi.personnel.changes.event.mapper.EventRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 员工事件记录
 * 业务层执行
 * @author Drj 2021/6/28
 */
@Service
public class EventRecordServiceImpl implements IEventRecordService {
    @Autowired
    private EventRecordMapper eventRecordMapper;

    /**
     * 获取所有员工事件记录
     *
     * @param eventRecord 搜索条件
     * @return
     */
    @Override
    public List<EventRecord> selectEventRecordList(EventRecord eventRecord) {
        return eventRecordMapper.selectEventRecordList(eventRecord);
    }

    /**
     * 获取指定员工事件记录
     *
     * @param eventRecordId 员工事件记录编号
     * @return
     */
    @Override
    public EventRecord selectEventRecordById(String eventRecordId) {
        return eventRecordMapper.selectEventRecordById(eventRecordId);
    }

    /**
     * 新增员工事件记录
     *
     * @param eventRecord 员工事件记录
     * @return
     */
    @Override
    public int insertEventRecord(EventRecord eventRecord) {
        return eventRecordMapper.insertEventRecord(eventRecord);
    }

    /**
     * 修改员工事件记录
     *
     * @param eventRecord 员工事件记录
     * @return
     */
    @Override
    public int updateEventRecord(EventRecord eventRecord) {
        return eventRecordMapper.updateEventRecord(eventRecord);
    }

    /**
     * 删除员工事件记录
     * 仅修改删除标志
     *
     * @param eventRecord
     * @return
     */
    @Override
    public int updateEventRecordDeleteFlag(EventRecord eventRecord) {
        return eventRecordMapper.updateEventRecordDeleteFlag(eventRecord);
    }
}
